import { http } from '@/utils/request'
export interface IReqLoginData {
  token: string
}
export interface IResUserInfoData {
  avatar: string
  buttons: string[]
  name: string
  roles: string[]
  routes: string[]
}
/**
 * @desc 登录
 * @param username 用户名
 * @param password 密码
 */
export const reqLogin = (username: string, password: string) => {
  return http<IReqLoginData>('/admin/acl/index/login', 'POST', { username, password })
}
/**
 * @desc 获取用户信息
 * @returns Promise
 */
export const reqUserInfo = () => {
  return http<IResUserInfoData>('/admin/acl/index/info', 'GET')
}
/**
 *  @desc退出功能
 */
export const reqLogout = () => {
  return http('/admin/acl/index/logout', 'POST')
}
